package com.example.managemyself.data.dao;

import androidx.lifecycle.LiveData;
import androidx.room.Dao;
import androidx.room.Insert;
import androidx.room.OnConflictStrategy;
import androidx.room.Query;
import com.example.managemyself.data.model.HealthData;
import java.util.Date;
import java.util.List;

@Dao
public interface HealthDataDao {

    @Insert(onConflict = OnConflictStrategy.REPLACE)
    void insertOrUpdate(HealthData healthData);

    @Query("SELECT * FROM health_data WHERE date = :date")
    LiveData<HealthData> getHealthDataByDate(Date date);

    @Query("SELECT * FROM health_data ORDER BY date ASC")
    LiveData<List<HealthData>> getAllHealthData();
} 